<?php

namespace frontend\controllers;

use Yii;
use frontend\components\Controller;
use frontend\models\SchoolCourseSearch;

/**
 * 学校详情接口
 * SchoolController
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class SchoolController extends Controller {

    /**
     * Declares the allowed HTTP verbs.
     * Please refer to [[VerbFilter::actions]] on how to declare the allowed verbs.
     * @return array the allowed HTTP verbs.
     */
    protected function verbs() {
        return [
            '*' => ['GET'],
        ];
    }

    public $modelClass = 'frontend\models\SchoolSearch';

    /**
     * {@inheritdoc}
     */
    public function actions() {
        return [
            'view' => [
                'class' => 'yii\rest\ViewAction',
                'modelClass' => $this->modelClass,
            ],
        ];
    }

    /**
     * 学校精品课程
     * @return mixed
     */
    public function actionCourse($id) {
        $model = new SchoolCourseSearch();
        return $model->search($id);
    }

}
